<?php

//过滤控制器
class Filter extends Controller {

	var $viewpath;
	var $is_logined;
	var $prepage = 20;
	
	function Filter()
	{
		parent::Controller();
		$this->viewpath = 'admin/'.__CLASS__;
		$this->load->model('managers_model','mm');
		$this->load->model("system_model");
		$this->is_logined = $this->mm->is_logined();
	}
	
	//敏感词过滤
	function index()
	{
		if($dosubmit = p("dosubmit")) {
			//验证用户名
			$words = p("words", false);
			$result = $this->system_model->filter($words);
			if($result) {//提示成功
				admin_show_success("更新成功", $this->config->item('admin_path')."/filter/");
			} else {
				admin_show_failed("更新失败");
			}
		}
		$words = $this->system_model->get_filter();
		$viewdata['viewpath'] = $this->viewpath;
		$viewdata['words'] = $words;
		$this->load->view($this->viewpath.'/index', $viewdata);
	}
}

/* End of file */